﻿<UserControl x:Class="StatusContentView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="250" d:DesignWidth="240">

    <UserControl.Resources>
        <Style TargetType="Border" x:Key="DNSBox">
            <Setter Property="CornerRadius" Value="8"/>
            <Setter Property="BorderBrush" Value="#FFCFDBEB"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="MaxHeight" Value="30"/>
            <Setter Property="Background">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#66E5E5E5" Offset="0"/>
                        <GradientStop Color="#66FFFFFF" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
        </Style>


        <Style TargetType="TextBox" x:Key="DNSTextBox">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="TextAlignment" Value="Center"/>
            <Setter Property="FontSize" Value="18"/>
            <Setter Property="Foreground" Value="{StaticResource Font_Brush_DarkBlue}"/>
            <Setter Property="FontWeight" Value="Medium"/>
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="MaxHeight" Value="20"/>
            <Setter Property="Margin" Value="5,-5,5,0"/>
        </Style>

        <Style TargetType="TextBlock" x:Key="DNSTextBlockTitle">
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="FontWeight" Value="Normal"/>
            <Setter Property="TextAlignment" Value="Center"/>
            <Setter Property="Margin" Value="0,5,0,3"/>
            <Setter Property="Foreground" Value="{StaticResource Font_Brush_Black}"/>
        </Style>

    </UserControl.Resources>
    <Border Style="{StaticResource MainContent_InfoBar}">
        <Grid>

            <Grid Margin="15" VerticalAlignment="Center" Visibility="{Binding SelectedInterface,Converter={StaticResource NothingToVisiblity}}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="10"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>

                <Rectangle Fill="{DynamicResource Brush_Warning}" Width="5" Height="12" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,2,0,0">
                    <Rectangle.OpacityMask>
                        <VisualBrush Visual="{StaticResource appbar_exclamation}"/>
                    </Rectangle.OpacityMask>
                </Rectangle>

                <TextBlock Grid.Column="1" Text="The selected Network Interface is not detected as Active, please check your configurations and if you have an active Internet Connection." TextWrapping="Wrap"/>

            </Grid>
            
        <Grid Visibility="{Binding SelectedInterface,Converter={StaticResource NothingToVisiblity},ConverterParameter=True}">
            <Grid.RowDefinitions>
                <RowDefinition Height="10"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>


            <TextBlock Grid.Row="1" Text="Primary DNS" Style="{StaticResource DNSTextBlockTitle}">
                <TextBlock.Effect>
                    <DropShadowEffect Color="White" ShadowDepth="2"/>
                </TextBlock.Effect>
            </TextBlock>
            
            <Border Grid.Row="2"  Style="{StaticResource DNSBox}" Padding="5" Margin="20,0">
                <TextBox Text="{Binding SelectedInterface.PrimaryDNS}" Style="{StaticResource DNSTextBox}" IsReadOnly="True"/>
            </Border>


            <TextBlock Grid.Row="3" Text="Secondary DNS" Style="{StaticResource DNSTextBlockTitle}">
                <TextBlock.Effect>
                    <DropShadowEffect Color="White" ShadowDepth="2"/>
                </TextBlock.Effect>
            </TextBlock>

            <Border Grid.Row="4"  Style="{StaticResource DNSBox}" Padding="5" Margin="20,0">
                <TextBox Text="{Binding SelectedInterface.SecondaryDNS}" Style="{StaticResource DNSTextBox}"  IsReadOnly="True"/>
            </Border>

            <TextBlock Grid.Row="5" Text="Using Tunlr.net DNS server's" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding SyncEnable,Converter={StaticResource BoolToVisiblity}}"/>
            <TextBlock Grid.Row="5" Text="Using Local DNS server's" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding SyncEnable,Converter={StaticResource BoolToVisiblity},ConverterParameter=True}"/>

            <Grid Grid.Row="6" Margin="5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="20"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>

                <Rectangle Fill="{DynamicResource Brush_Normal}" Width="12" Height="12" VerticalAlignment="Top" HorizontalAlignment="Left">
                    <Rectangle.OpacityMask>
                        <VisualBrush Visual="{StaticResource appbar_information_circle}"/>
                    </Rectangle.OpacityMask>
                </Rectangle>

                <TextBlock Grid.Column="1" Text="If the application can not connect to Tunlr.net it will automaticly set your DNS to local." VerticalAlignment="Center" HorizontalAlignment="Left" TextWrapping="Wrap" FontSize="9" Foreground="{StaticResource Font_Brush_Gray}"/>
                
            </Grid>



        </Grid>
        </Grid>
    </Border>
    
</UserControl>
